<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/8
 * Time: 14:13
 */

namespace App\Http\Controllers\WeChat;


use App\Http\Controllers\Controller;
use EasyWeChat\Factory;
use Illuminate\Http\Request;


class WeChatConfigController extends Controller
{

    public function __construct(Request $request){
        $config = [
            'app_id' => 'wxf266cbed27421ecf',
            'secret' => 'a744bd3e2a46f082630a10a66e1edb7d',
            'token'  => 'dinghui',
            'response_type' => 'array',
            'oauth' => [
                'scopes'   => ['snsapi_userinfo'],
                'callback' => '/oauth_callback',
            ],
            'log' => [
                'level' => 'debug',
                'file' => __DIR__.'/wechat.log',
            ],
        ];

        $this->app = Factory::officialAccount($config);

        $this->oauth = $this->app->oauth;


    }

}